package com.hyt.it.ogt.pj.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyt.it.ogt.pj.model.entity.PaperItem;
import com.hyt.it.ogt.pj.model.vo.PaperItemVo;
import com.hyt.it.ogt.pj.model.vo.PaperResultVo;

/**
 * <p>
 * 题目表 Mapper 接口
 * </p>
 *
 * @author qiaozj
 * @since 2020-07-09
 */
public interface PaperItemMapper extends BaseMapper<PaperItem> {

    List<PaperItemVo> selectMarkItem(@Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("paperId") String paperId, @Param("encodeId") String encodeId);

    List<PaperItem> selectByPaperId(@Param("paperId") String paperId);

    List<PaperItem> selectByPaperIdByParentId(@Param("paperId") String paperId, @Param("parentId") String parentId);

    List<PaperItem> selectAllObjectiveItemByPaperId(@Param("paperId") String paperId);

    List<PaperItem> selectAllObjectiveItemByPaperIds(@Param("paperIds") List<String> paperId);

    List<PaperItemVo> selectSomeOneMarkItem(@Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("paperId") String paperId, @Param("encodeId") String encodeId, @Param("taskId") String taskId);


    /**
     * 查询主观题型名称
     *
     * @param projectId
     * @return
     */
    List<PaperResultVo> selectItemNameByProjectId(@Param("projectId") String projectId);

    /**
     * 获取考生得分
     *
     * @param projectId
     * @param subjectId
     * @param paperId
     * @param encodeId
     * @return
     */
    List<PaperItemVo> selectMarkItemScore(String projectId, String subjectId, String paperId, String encodeId);

    List<PaperItemVo> selectMarkItem2(@Param("taskId") String taskId, @Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("paperId") String paperId, @Param("encodeId") String encodeId, @Param("userId") String userId);

    /**
     * 获取主观题评卷内容
     *
     * @return
     */
    List<PaperItemVo> selectPaperItemVoList(@Param("paperId") String paperId);




    /**
     * 获取科目下的题目
     *
     * @param currUserId
     * @param projectId
     * @param subjectId
     * @param itemId
     * @return
     */
    PaperItemVo selectProjectItem(@Param("currUserId") String currUserId, @Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("itemId") String itemId);

    /**
     * 获取科目下的所有题目
     *
     * @param projectId
     * @param subjectId
     * @return
     */
    List<PaperItemVo> selectPaperItemVoListByCondition(@Param("projectId") String projectId, @Param("subjectId") String subjectId);

    /**
     * 获取试卷下的所有大题
     *
     * @return
     */
    List<PaperItemVo> selectParentItem(@Param("paperId") String paperId);

    /**
     * 获取试卷主观题
     *
     * @param projectId
     * @param subjectId
     * @return
     */
    List<PaperItem> getPaperItemSubjective(String projectId, String subjectId);


    /**
     * 获取试卷主观题
     * @param projectId
     * @param subjectIds
     * @return
     */
    List<PaperItem> getPaperItemSubjectives(String projectId, List<String> subjectIds);

    /**
     * 获取主观题总分数
     *
     * @param projectId
     * @param subjectId
     * @return
     */
    BigDecimal getPaperSubjectiveScore(String projectId, String subjectId);
}
